<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test</title>
</head>
<script src="./jquery.js"></script>
<script>

    $(function(){

        $("#addOrder").click(function () {
            $.ajax({
                type: "POST",
                url: "http://localhost:8080/order/create/1",
                data: JSON.stringify({
                    "price": "12.3"
                }) ,
                contentType: "application/json;charset=utf-8",
                success: function(msg){
                    window.location.href=`order.html?id=${msg}`
                }
            });

        })
    });

</script>
<body>
<div>
    <div>userId: 1</div>
    <button id="addOrder">下单</button>
</div>
</body>
</html>